package com.code.base.dic.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.dic.persistence.DicBankCodeMapper;
import com.code.base.dic.pojo.DicBankCode;
import com.code.util.PrimaryKeyUtil;


@Service
public class DicBankCodeService {


	@Resource
	private DicBankCodeMapper dicBankCodeMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public DicBankCode getDataById(Long id) {
		return dicBankCodeMapper.getDataById(id);
	}

	public List<DicBankCode> getAllData() {
		return dicBankCodeMapper.getAllData();
	}

	public int getDataCountByCondition(DicBankCode entity) {
		return dicBankCodeMapper.getDataCountByCondition(entity);
	}

	public List<DicBankCode> getDataByCondition(DicBankCode entity) {
		return dicBankCodeMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(DicBankCode entity) {
		return dicBankCodeMapper.getDataCountByLikeCondition(entity);
	}

	public List<DicBankCode> getDataByLikeCondition(DicBankCode entity) {
		return dicBankCodeMapper.getDataByLikeCondition(entity);
	}

	public List<DicBankCode> getDataByIds(Long[] ids) {
		return dicBankCodeMapper.getDataByIds(ids);
	}

	public void insertData(DicBankCode entity) {
		insertData(entity, true);
	}

	public void insertData(DicBankCode entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		dicBankCodeMapper.insertData(entity);
	}

	public void updateData(DicBankCode entity) {
		dicBankCodeMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		dicBankCodeMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(DicBankCode entity) {
		dicBankCodeMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		dicBankCodeMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		dicBankCodeMapper.deleteDataByIds(ids);
	}

}
